package com.sc.service.member;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sc.dal.dto.member.AgentDto;
import com.sc.dal.mapper.member.AgentMapper;
import com.sc.dal.model.ParamMap;
import com.sc.dal.model.member.Agent;
/**
 * 代理商的业务层代码
 * <h1>类注释说明</h1> 
 * 
 * @author xujunbao 
 * @version AgentService.java,v0.1 2017年4月5日 下午2:09:41 xujunbao Exp  
 *
 */
@Service
public class AgentService {
	@Autowired
	private AgentMapper agentMapper;
	@Autowired
	private MemberService memberService;
	/**
	 * 添加代理商
	 * <h2>方法注释说明</h2> 
	 * 
	 * @param agent
	 * @return void 
	 * @throws
	 */
	public void insertAgent(Agent agent){
		agentMapper.insertSelective(agent);
	}
	/**
	 *  根据主键获取代理商信息
	 * <h2>方法注释说明</h2> 
	 * 
	 * @param id
	 * @return
	 * @return Agent 
	 * @throws
	 */
	public Agent selectByPrimaryKey(String id){
		return agentMapper.selectByPrimaryKey(id);
	}
	public void updateAgent(Agent agent){
		agentMapper.updateByPrimaryKeySelective(agent);
	}
	public List<AgentDto> selectList(ParamMap paramMap) {
		// TODO Auto-generated method stub
		return agentMapper.selectList(paramMap);
	}
	public void updateAgentBymId(Agent agent) {
		// TODO Auto-generated method stub
		agentMapper.updateAgentBymId(agent);
	}
	public void updateByPrimaryKeySelective(Agent agent) {
		// TODO Auto-generated method stub
		agentMapper.updateByPrimaryKeySelective(agent);
	}
}
